<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>04-动画与过渡的区别</title>
  <style>
    .outer{
      width: 1000px;
      height: 200px;
      border: 1px solid black;
    }
    .inner{
      width: 100px;
      height: 100px;
    }
    .inner1{
      background-color: purple;
      transition: all 1s linear;
    }

    /* 使用过渡移动 */
    .outer:hover .inner1{
      transform: translate(900px);
    }

    /* 使用动画移动 */

    .inner2{
      background-color: skyblue;
      animation: yidong 1s linear forwards;
    }
    @keyframes yidong {
      0%{

      }
      100%{
        transform: translate(900px);
      }
    }

  </style>
</head>
<body>
  <div class="outer">
    <div class="inner inner1"></div>
    <div class="inner inner2"></div>

  </div>
  
</body>
</html>